<?php  
class ImagesController extends AppController 
{ 
    var $name = 'Images'; 
    var $components = array('Thumb', 'context'); 
    var $uses = array('Image'); 
     
  function index() {
    $this->context->method='index';
    $this->context->checkSession($this);
    $this->layout="admin";

    $images=$this->Image->findAll();
    $this->set('images', $images);
  } 
     
  function admin_index() {
    $this->context->method='index';
    $this->context->checkSession($this);
    $this->layout="admin";

    $images=$this->Image->findAll();
    $this->set('images', $images);
  } 
	
    function admin_add(){ 
        if(!empty($this->data)){ 
            if($this->data['Image']['thumbnail']['size']){ 
                pr($this->data); 
                if(!$this->Thumb->generateThumb('thumbnail','Image')){ 
                    pr($this->Thumb->errors); 
                }             
            } 
        } 
    }

} 
?>